unit uCode;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Input1, DB, StdCtrls, Mask, DBCtrls, KDBEdit,
  ImgList, ComCtrls,
  ToolWin, Buttons, ExtCtrls, KLookUp, ADODB;

type
  TfrmCode = class(TfrmInput1)
    KDBEdit4: TKDBEdit;
    KDBEdit3: TKDBEdit;
    KDBEdit2: TKDBEdit;
    KDBEdit1: TKDBEdit;
    KDBEdit5: TKDBEdit;
    qMasterCODE: TWideStringField;
    qMasterCODENAME: TWideStringField;
    qMasterCODENO: TWideStringField;
    qMasterCODEYEAR: TWideStringField;
    qMasterCODEREP: TWideStringField;
    procedure KDBEdit5SpeedButtonClick(Sender: TObject;
      var Accept: Boolean);
  private
    protected
    function GetParamValue: String; override;
    function ListRefreshData: TCustomKLookUp; override;
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmCode: TfrmCode;

implementation

uses FileCtrl,uDataModule;
{$R *.dfm}

function TfrmCode.GetParamValue: String;
begin
      Result := DataModule1.qCodeCODE.AsString;
end;

function TfrmCode.ListRefreshData: TCustomKLookUp;
begin
      Result := DataModule1.ListCode;
end;


procedure TfrmCode.KDBEdit5SpeedButtonClick(Sender: TObject;
  var Accept: Boolean);
var Dir: string;
begin
  inherited;
  Dir := TKDBEdit(Sender).Text;
  if SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt], 0) then
  TKDBEdit(Sender).Field.AsString := Dir+'\';

end;

end.
